"""服务器实时负载信息"""

import time, json, psutil
from src.core.variables.status import *
from src.core.variables.function import *
from src.core.variables.cache import Cache


def reaload():
    memory_info = psutil.virtual_memory()
    disk_usage = psutil.disk_usage("/")
    result = {
        "cpu": psutil.cpu_percent(interval=None, percpu=False),  # cpu使用率 (%)
        "mem": memory_info.percent,  # 内存使用率 (%)
        "disk": disk_usage.percent,  # 根目录分区使用率 (%)
    }
    return SUCCESS_CODE_CUSTOMIZE(result, 200)
